﻿using Guoc.BigMall.Domain.ValueObject;
using Guoc.BigMall.Infrastructure.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Guoc.BigMall.WebService.Dto
{
    public class SaleOrderVo
    {
        public SaleOrderVo()
        {
            this.Items = new List<SaleOrderItemVo>();
        }

        /// <summary>
        ///  销售单Id
        /// </summary>
        public int Id { get; set; }

        public string Code { get; set; }

        public DateTime CreatedOn { get; set; }

        public SaleOrderStatus Status { get; set; }

        public string StatusName {
            get { return this.Status.Description(); }
        }


        public List<SaleOrderItemVo> Items { get; set; }

        public decimal TotalAmount
        {
            get
            {
                return Items.Sum(n => n.getAmount());
            }
        }

        
    }
}
